::[Bat To Exe Converter]
::
::YAwzoRdxOk+EWAnk
::fBw5plQjdCuDJEmW+0g1KwhoQAWAcWK+A7Qg5env+++Vnk4RXecxbLPIyLeyLeEa5Hn2cIUiw2hZndgwBRhXcFyibQBU
::YAwzuBVtJxjWCl3EqQJgSA==
::ZR4luwNxJguZRRnk
::Yhs/ulQjdF+5
::cxAkpRVqdFKZSzk=
::cBs/ulQjdF+5
::ZR41oxFsdFKZSDk=
::eBoioBt6dFKZSDk=
::cRo6pxp7LAbNWATEpCI=
::egkzugNsPRvcWATEpCI=
::dAsiuh18IRvcCxnZtBJQ
::cRYluBh/LU+EWAnk
::YxY4rhs+aU+JeA==
::cxY6rQJ7JhzQF1fEqQJQ
::ZQ05rAF9IBncCkqN+0xwdVs0
::ZQ05rAF9IAHYFVzEqQJQ
::eg0/rx1wNQPfEVWB+kM9LVsJDGQ=
::fBEirQZwNQPfEVWB+kM9LVsJDGQ=
::cRolqwZ3JBvQF1fEqQJQ
::dhA7uBVwLU+EWDk=
::YQ03rBFzNR3SWATElA==
::dhAmsQZ3MwfNWATElA==
::ZQ0/vhVqMQ3MEVWAtB9wSA==
::Zg8zqx1/OA3MEVWAtB9wSA==
::dhA7pRFwIByZRRnk
::Zh4grVQjdCuDJEmW+0g1KwhoQAWAcWK+A7Qg+u336uuUp3GYuRi3mXteDXELxTdeYooA8U36UamBHxDzMAldbQaqfBt6rHZH1g==
::YB416Ek+ZG8=
::
::
::978f952a14a936cc963da21a135fa983
@echo off
set appName=bl-tool
set jarFile=bl-tool-1.0.jar
set home=%~dp0
echo home %home% 

echo find %appName% to kill
for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %appName%`) do (
	set pid=%%a
	set image_name=%%b
)
if not defined pid (echo process %appName% does not runing) else (
	echo prepare to kill %image_name%
	echo start kill %pid% ...
	taskkill /f /pid %pid%
)

echo starting %jarFile%
%home%jre\bin\javaw -Dfile.encoding=utf-8 -jar %jarFile% --spring.profiles.active=prod --conf=%home%conf 2>&1 &

for /f "usebackq tokens=1-2" %%a in (`jps -l ^| findstr %jarFile%`) do (
	set pid=%%a
	set image_name=%%b
	echo %%a >%appName%.pid
)
exit